# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emacs/navi2ch/navi2ch-1.7.5.ebuild,v 1.4 2005/07/09 19:35:51 swegener Exp $

inherit elisp gnuconfig

EAPI="prefix"

IUSE=""

DESCRIPTION="Navi2ch is navigator for 2ch which works under many Emacsen"
HOMEPAGE="http://navi2ch.sourceforge.net/"
#SRC_URI="mirror://sourceforge/navi2ch/${P}.tar.gz"
SRC_URI="http://navi2ch.sourceforge.net/snapshot/${P/1.7.5./cvs_}-1.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc-macos ~ppc64 ~sparc ~x86 ~x86-macos"

SITEFILE=50navi2ch-gentoo.el

S=${WORKDIR}/${P/1.7.5.0.0./cvs-}

#src_unpack() {
#	unpack ${A}
#	cd ${S}
#	gnuconfig_update
#}

src_compile() {
	econf || die "econf failed"
	emake || die "emake failed"
}

src_install() {
#	elisp-install navi2ch *.el *.elc || die
#	elisp-install navi2ch contrib/*.el || die

	echo "(princ data-directory)" >"${T}"/emacs-datadir.el
	EMACS_DD=`${EMACS_BATCH_CLEAN} -l "${T}"/emacs-datadir.el`

	einstall icondir="${D}${EMACS_DD}/icons" || die "einstall failed"	
	elisp-site-file-install ${FILESDIR}/${SITEFILE} || die
}

pkg_postinst() {
	elisp-site-regen
	einfo
	einfo "Please add to your .emacs"
	einfo "If you use mona-font,"
	einfo "\t(setq navi2ch-mona-enable t)"
	einfo "If you use izonmoji-mode,"
	einfo "\t(require 'izonmoji-mode)"
	einfo "\t(add-hook 'navi2ch-bm-mode-hook      'izonmoji-mode-on)"
	einfo "\t(add-hook 'navi2ch-article-mode-hook 'izonmoji-mode-on)"
	einfo "\t(add-hook 'navi2ch-popup-article-mode-hook 'izonmoji-mode-on)"
	einfo
}
